package com.insta.formation.library.model.impl;

import java.util.Date;

import com.insta.formation.library.model.IBook;
import com.insta.formation.library.model.IRentBook;
import com.insta.formation.library.model.IUser;

public class Rent implements IRentBook
{

	private IUser user;
	private IBook book;
	private Date startDate;
	private boolean isReturn;
	private Date returnDate;
	private int id;

	public Rent(IUser user, IBook book) {

		super();
		this.user = user;
		this.book = book;

		startDate = new Date();
		isReturn = false;
	}

	// Constructeur pour le DAO
	public Rent(int id, IUser user, IBook book, Date startDate, Date returnDate, boolean isReturn) {
		super();
		this.id = id;
		this.user = user;
		this.book = book;
		this.startDate = startDate;
		this.returnDate = returnDate;
		this.isReturn = isReturn;
	}

	public int getId()
	{
		return id;
	}

	public IUser getUser()
	{

		return user;
	}

	public IBook getBook()
	{
		return book;
	}

	public Date getStartDate()
	{

		return startDate;
	}

	public boolean isReturn()
	{

		return isReturn;
	}

	public Date getReturnDate()
	{

		return returnDate;
	}

	public void setReturnDate(Date _returnDate)
	{
		returnDate = _returnDate;
		isReturn = true;
	}

}
